<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!doctype html>

<html lang="en" class="no-js">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>Programme List</title>
<meta name="description" content="">
<meta name="author" content="">

<!-- Combined stylesheets load -->
<!-- Load either 960.gs.fluid or 960.gs to toggle between fixed and fluid layout -->
<link href="css/main.css" rel="stylesheet" type="text/css">

<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/png" href="favicon-large.png">

<!-- Modernizr for support detection, all javascript libs are moved right above </body> for better performance -->
<script src="js/libs/modernizr.custom.min.js"
	tppabs="http://www.display-inline.fr/demo/constellation/template/js/libs/modernizr.custom.min.js"></script>
<script src="js/index.js"></script>

</head>

<body>

	<!-- Header -->

	<!-- Server status -->
	<header></header>
	<!-- End server status -->

	<!-- Main nav -->
	<%@include file='header.jsp'%>

	<div id="header-shadow"></div>
	<!-- End header -->

	<!-- Always visible control bar -->
	<div id="control-bar" class="grey-bg clearfix">
		<div class="container_12"></div>
	</div>
	<!-- End control bar -->

	<!-- Content -->
	<article class="container_12">

		<section class="grid_8">
			<div class="block-border">
				<form class="block-content form" id="table_form" method="post"
					action="listProgramme">
					<h1>Programme List</h1>

					<div class="block-controls">
						<div class="float-right">
							<a class="button red" title="Add" href="addProgramme.jsp"> <span
								class="smaller">CREATE</span> </a> 
									<input type="checkbox" name="checkInclude" value="true"
                                           ${ checkInclude ? "checked" : "" }
                                           onclick="document.getElementById('table_form').submit();" />
                                    <label for="table-display" style="display: inline">Include
                                        In-active</label>

						</div>

						<ul class="controls-buttons" style="cursor:pointer">
                            <s:hidden type="hidden" id="filter" name="filter"/>
                            <s:hidden type="hidden" id="checkActive" name="checkActive"/>
                            <li><a onclick="document.getElementById('filter').value = 'all'; document.getElementById('table_form').submit();"> <strong>ALL</strong>
                                </a></li>
                            <li class="sep"></li>
                            <li><a onclick="document.getElementById('filter').value = '0-9'; document.getElementById('table_form').submit();"> <strong>0-9</strong>
                                </a></li>
                            <li><a onclick="document.getElementById('filter').value = 'ABCDE'; document.getElementById('table_form').submit();"> <strong>A B C D E</strong>
                                </a></li>
                            <li><a onclick="document.getElementById('filter').value = 'FGHIJ'; document.getElementById('table_form').submit();"> <strong>F G H
										I J</strong>
                                </a></li>

                            <li><a onclick="document.getElementById('filter').value = 'KLMN'; document.getElementById('table_form').submit();"> <strong>K L M N
                                    </strong>
                                </a></li>

                            <li><a onclick="document.getElementById('filter').value = 'OPQR'; document.getElementById('table_form').submit();"> <strong>O P Q R
                                    </strong>
                                </a></li>

                            <li><a onclick="document.getElementById('filter').value = 'STUV'; document.getElementById('table_form').submit();"> <strong>S T U V
                                    </strong>
                                </a></li>

                            <li><a onclick="document.getElementById('filter').value = 'WXYZ'; document.getElementById('table_form').submit();"> <strong>W X Y Z
                                    </strong>
                                </a></li>

                        </ul>


					</div>

					<div class="no-margin">
						<s:form class="block-content form" id="table_form2" name="fom" action="delete" >
							<div class="no-margin">
							<table class="table" id="tablepaging" cellspacing="0"
								width="100%">
								<thead>
									<tr>

										<th scope="col">ID</th>
										<th scope="col">Programme Name</th>
										<th scope="col">Description</th>
										<th scope="col">Active</th>
										<th scope="col">Contact</th>
										<th scope="col" class="table-actions">Actions</th>
									</tr>
								</thead>
								<s:iterator value="programmeList" var="prog">
									<tr>

										<td><s:property value="programmeID" /></td>
										<td><s:property value="programmeName" /></td>
										<td><s:property value="description" /></td>
										<td><s:property value="isActive" /></td>
										<td><s:property value="contactName" /></td>

										<td class="table-actions"><a
											href="javascript:editr(<s:property value="programmeID"/>)"
											title="Edit" class="with-tip"><img
												src="images/icons/fugue/pencil.png" width="16" height="16">
										</a> <a href="javascript:delete1(<s:property value="programmeID"/>)" title="Delete" class="with-tip"><img
												src="images/icons/fugue/cross-circle.png" width="16"
												height="16"> </a></td>
									</tr>
								</s:iterator>
							</table>
							</div>
						</s:form>
					</div>


					<div class="block-footer" id="pageNavPosition">
						<script type="text/javascript">
							var pager = new Pager('tablepaging', 5);
							pager.init();
							pager.showPageNav('pager', 'pageNavPosition');
							pager.showPage(1);
						</script>
					</div>

				</form>
			</div>
		</section>




		<div class="clear"></div>

	</article>

	<!-- End content -->

	<footer>


	</footer>	
	<script>
		function editr(val) {
			window.location.href = 'fetch?programmeID=' + val;
		}
		function delete1(val) {
			window.location.href = 'delete?programmeID=' + val;
		}
	</script>

</body>
</html>